#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use Net::Telnet;

my $ua=LWP::UserAgent->new;

my $request = HTTP::Request->new(GET => "http://www.salttiger.com/");
my $res = $ua->request($request);


if($res->is_success)
{
	foreach my $link ($res->content=~/(ed2k\:\/\/.*?\/)/g)
	{
		&ml_cmd("dllink $link")
	}
}

sub ml_cmd
{
	my ($command)=@_;
	my $telnet=Net::Telnet->new(Timeout=>20,Host=>"localhost",Port=>10000);
	my @out=$telnet->waitfor('/>/');
	@out=$telnet->cmd($command);
	$telnet->close;
	
	return 0;
}
